================================================================================
  AutoHideCursor Plugin - NeoDX Compatibility Guide
================================================================================

PROBLEM:
When using the AutoHideCursor plugin with the NeoDX video/audio plugin, the
cursor doesn't hide immediately when you first start auto-hide. It only works
after you move the mouse once.

WHY THIS HAPPENS:
NeoDX uses its own custom internal cursor (DirectX-based), which is different
from the standard Windows cursor. When our plugin starts, it tries to hide
the cursor, but NeoDX's custom cursor isn't recognized by Windows as a regular
cursor. Once you move the mouse, NeoDX switches to the standard Windows cursor,
and then our plugin can control it normally.

SOLUTION:
Use the new "refreshCursor" command to force the cursor to sync with Windows.

================================================================================
UPDATED COMMAND LIST (6 COMMANDS)
================================================================================

1. startAutoHideCursor "[timeout_ms]"  - Start auto-hiding
2. stopAutoHideCursor                  - Stop auto-hiding
3. setAutoHideTimeout "[timeout_ms]"   - Change timeout
4. hideCursorNow                       - Hide immediately
5. showCursorNow                       - Show immediately
6. refreshCursor                       - Force cursor refresh (NEW!)

================================================================================
HOW TO USE WITH NEODX
================================================================================

BASIC USAGE:
------------

. Start NeoDX video
NeoDX_Play "MyVideo.mp4"

. Enable auto-hide
startAutoHideCursor "3000"

. Force cursor refresh to sync with Windows
refreshCursor


COMPLETE EXAMPLE - VIDEO PLAYER:
---------------------------------

--- On "Play Video" Button Click ---
. Start video playback
NeoDX_Play "MyVideo" "[VideoPath][CurrentVideo].mp4"

. Enable auto-hide with 3-second timeout
startAutoHideCursor "3000"

. Force cursor refresh for NeoDX compatibility
refreshCursor

--- On "Pause Video" Button Click ---
. Pause video
NeoDX_Pause "MyVideo"

. Stop auto-hide and show cursor
stopAutoHideCursor

--- On "Stop Video" Button Click ---
. Stop video
NeoDX_Stop "MyVideo"

. Ensure cursor is visible
stopAutoHideCursor

--- On Page Leave ---
. Always cleanup
NeoDX_Close "MyVideo"
stopAutoHideCursor


FULLSCREEN VIDEO WITH NEODX:
-----------------------------

--- On PageEnter ---
. Go fullscreen
Maximize
HideTitleBar

. Start video
NeoDX_Play "VideoPlayer" "[VideoFile]"

. Enable auto-hide
startAutoHideCursor "2500"

. Refresh cursor to activate immediately
refreshCursor

--- On ESC Key or "Exit" Button ---
. Stop video
NeoDX_Stop "VideoPlayer"

. Exit fullscreen
stopAutoHideCursor
ShowTitleBar
Restore

. Go back
GotoPreviousPage


VIDEO WITH CUSTOM CONTROLS:
----------------------------

--- On Video Page Enter ---
. Start video
NeoDX_Play "MainVideo" "[VideoPath]"

. Enable auto-hide with 4-second delay
startAutoHideCursor "4000"
refreshCursor

. Hide control panel initially
Hide "ControlPanel"

--- On Mouse Move Event ---
. Show controls when mouse moves
Show "ControlPanel"

. Cursor will automatically show and then hide after 4 seconds

--- On Volume Slider Change ---
. Adjust volume
GetVar "[Volume]" "VolumeSlider"
NeoDX_Volume "MainVideo" "[Volume]"

. Keep cursor visible during interaction
showCursorNow

--- On Play/Pause Toggle ---
If "[IsPlaying]" "=" "True"
    NeoDX_Pause "MainVideo"
    SetVar "[IsPlaying]" "False"
    stopAutoHideCursor
Else
    NeoDX_Play "MainVideo"
    SetVar "[IsPlaying]" "True"
    startAutoHideCursor "4000"
    refreshCursor
EndIf


SLIDESHOW WITH VIDEO TRANSITIONS (NeoDX):
------------------------------------------

--- On Slideshow Start ---
. Enable auto-hide
startAutoHideCursor "3000"
refreshCursor

. Show first image
PictureLoad "ImageDisplay" "[ImagePath]Image1.jpg"

--- On Transition to Next Image ---
. Play transition effect video
NeoDX_Play "Transition" "transition.mp4"

. Refresh cursor (NeoDX just started)
refreshCursor

. Wait for transition to complete
Wait "1000"

. Stop transition
NeoDX_Stop "Transition"

. Load next image
SetVar "[CurrentImage]" "[Math "[CurrentImage]" "+" "1"]"
PictureLoad "ImageDisplay" "[ImagePath]Image[CurrentImage].jpg"


AUDIO PLAYER WITH NEODX:
-------------------------

--- On "Play Audio" Button ---
. Start audio playback
NeoDX_PlayAudio "AudioPlayer" "[AudioFile]"

. Enable auto-hide for clean interface
startAutoHideCursor "3000"
refreshCursor

--- On "Stop Audio" Button ---
. Stop audio
NeoDX_StopAudio "AudioPlayer"

. Show cursor
stopAutoHideCursor


================================================================================
IMPORTANT NOTES
================================================================================

1. ALWAYS call refreshCursor immediately after startAutoHideCursor when using
   NeoDX to ensure the cursor hides properly from the start.

2. The refreshCursor command is harmless and can be used even when NeoDX isn't
   active. It simply forces Windows to recognize the current cursor state.

3. If you're switching between NeoDX videos, call refreshCursor again:
   
   NeoDX_Stop "Video1"
   NeoDX_Play "Video2" "[NextVideo]"
   refreshCursor

4. The command works by slightly moving the cursor position (1 pixel) and back,
   which forces Windows to redraw it. This is imperceptible to users.

5. You only need refreshCursor when STARTING auto-hide with NeoDX active.
   Once the cursor is hidden/shown once, it works normally.

================================================================================
TROUBLESHOOTING
================================================================================

PROBLEM: Cursor still doesn't hide with NeoDX
SOLUTION: Make sure you call refreshCursor AFTER startAutoHideCursor:
          
          startAutoHideCursor "3000"
          refreshCursor          . This is the correct order


PROBLEM: Cursor flickers when using refreshCursor
SOLUTION: Only call refreshCursor when starting NeoDX or auto-hide, not
          repeatedly in loops or timers.


PROBLEM: Works with images but not NeoDX videos
SOLUTION: This confirms it's a NeoDX cursor issue. Use refreshCursor as shown
          in the examples above.


PROBLEM: Cursor hides but doesn't reappear when moving mouse
SOLUTION: This is a different issue. Make sure NeoDX isn't capturing mouse
          events. Try using NeoDX_SetMouseCapture "False" if available.

================================================================================
TECHNICAL EXPLANATION
================================================================================

Why refreshCursor works:
- NeoDX creates a custom DirectX cursor overlay
- Windows doesn't recognize this as the system cursor
- Our plugin can only control the Windows system cursor
- By moving the cursor 1 pixel and back, we force:
  1. NeoDX to release its custom cursor
  2. Windows to take over with the system cursor
  3. Our plugin can now control it
- This happens instantly (imperceptible to users)

The refreshCursor command essentially does:
1. Gets current cursor position
2. Moves cursor 1 pixel right
3. Moves cursor back to original position
4. Resets auto-hide timer
5. Ensures cursor is visible and trackable

================================================================================
VERSION INFO
================================================================================

Plugin Version: 1.1
New Command: refreshCursor
Purpose: NeoDX and custom cursor plugin compatibility
Added: 2024

================================================================================
